const testApi = {
  auth: {
    prepare: 'https://www.edooschool.com/edooteach-tencent/weapp/auth/prepare?code=',
    login: 'https://www.edooschool.com/edooteach-tencent/weapp/auth/login'
  },
  url: "https://www.edooschool.com/edooteach-api-test"
}

const prodApi = {
  auth: {
    prepare: 'https://www.edooschool.com/edooteach-tencent/weapp/auth/prepare?code=',
    login: 'https://www.edooschool.com/edooteach-tencent/weapp/auth/login'
  },
  url: "https://www.edooschool.com/edooteach-api"
}

const redirectUrl = {
  "profile": "/pages/profile/profile",
  "mall": "/pages/mall/mall",
  "mallDetail": function(id) {
    var url = "/pages/mall-detail/mall-detail"
    console.log(url);
    return url + "?id=" + id;
  },
  "product": "/pages/product/detail/detail",
  "productDetail": function(id) {
    var url = "/pages/product/unit-list/unit-list"
    return url + "?id=" + id;
  }
}

const api = prod => {
  return prod ? prodApi : testApi
}

const resource = {
  qiniu: "https://prod.qiniu.fit-start.co/",
  FU_XING: 5
}

module.exports = {
  api: api,
  redirectUrl: redirectUrl,
  resource: resource
}